<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>


        // let arr = [2,3,1,7,4]
        // let sum = 0
        // for(let i = 0; i < arr.length ;i++){
        //     sum += arr[i]
        // }
        // let pjz = sum/arr.length
        // alert(sum)
        //alert(pjz)


        //数组求最大值和最小值
        let arr1 = [2,6,1,77,52,25,7]
        let max = arr1[0]
        for(let b = 1;b < arr1.length ; b++){
            if(arr1[b]>max){
                max = arr1[b]
            }
        }
        alert(max)



        let arr = [2,6,1,77,52,25,7]
        let min = arr[0]
        for(let c = 1;c < arr.length ; c++){
            if(arr[c]<min){
                min = arr[c]
            }
        }
        alert(min)

    </script>
</body>
</html>